/**
 * @param {string} s
 * @return {string}
 */
var replaceSpace = function (s) {
  let resStr = "";
  let len = s.length;
  for (let index = 0; index < len; index++) {
    if (s.charAt(index) == " ") {
      resStr += "%20";
    } else {
      resStr += s.charAt(index);
    }
  }
  return resStr;
};
